How to write unit test for a function in button click in angular